<script setup>
import {ref} from "vue";
import {invoke} from "@tauri-apps/api/core";
import TopBar from "./Components/TopBar.vue"

const greetMsg = ref("");
const name = ref("");

async function greet() {
  // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
  greetMsg.value = await invoke("greet", {name: name.value});
}

async function startWebService() {
  await invoke("start_web_service",);
}
</script>

<template>
  <v-app>
    <v-layout class="rounded rounded-md">
      <TopBar></TopBar>

      <v-main class="d-flex align-center justify-center" height="300">
        <v-container>
          <v-card>
            <v-card-title class="text-overline">{{ greetMsg }}</v-card-title>
            <v-text-field label="Name" v-model="name"></v-text-field>
            <v-card-actions>
              <v-btn color="primary" @click="greet">Greet</v-btn>
              <v-btn color="primary" @click="startWebService">Start Web</v-btn>
            </v-card-actions>
          </v-card>
        </v-container>
      </v-main>
    </v-layout>
  </v-app>
</template>
<style scoped>


</style>
<style>

</style>
